home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / MAKEFILE.UNX < prev    next >
Encoding:
Text File  |  1997-09-14  |  22.9 KB  |  755 lines

  1. #
  2. # Makefile for Tampa Network Operating System (TNOS)
  3. #
  4.  
  5. ##############################################################################
  6. #                                                                            #
  7. # The values in this Makefile SHOULD NOT need to be altered, and temptation  #
  8. # to do so should be resisted. Doing so will make it easier to have major    #
  9. # problems down the road as you upgrade to later versions.                   #
  10. #                                                                            #
  11. # Instead, all local customizations should be placed in a separate file,     #
  12. # named 'make.inc'. This file (if it exists) is included in the processing   #
  13. # of this Makefile, and anything in that file can override settings in       #
  14. # this file.                                                                 #
  15. #                                                                            #
  16. # Just say NO to editing the Makefile! If the author can resist the          #
  17. # temptation, so can you ;-)                                                 #
  18. #                                                                            #
  19. # There ARE notes throughout this Makefile as to things that you MAY wish    #
  20. # to override in 'make.inc', so you are encouraged to look through here, and #
  21. # build your own 'make.inc' as needed.                                       #
  22. #                                                                            #
  23. ##############################################################################
  24.  
  25.  
  26. #######################
  27. #                     #
  28. #  Version Variables  #
  29. #                     #
  30. # DO NOT change these #
  31. #                     #
  32. #######################
  33.  
  34. VERSION = 2
  35. RELEASE = 3
  36. LEVEL = 0
  37.  
  38. # This defines whether this is a beta-test version or not. Make it blank
  39. # for release level compiles
  40. BETA = #-DBETA
  41.  
  42. ifdef BETA
  43. # This is either 'a' for alpha, 'b' for beta, 'pl' for a interim patch
  44. # level, or ignored for release level compiles
  45. SUBTYPE = b
  46.  
  47. # This will be ignored for release level compiles
  48. SUBLEVEL = 4
  49. endif
  50.  
  51. VSTR = $(VERSION).$(RELEASE)$(LEVEL)$(SUBTYPE)$(SUBLEVEL)
  52. DVSTR = $(VERSION)$(RELEASE)$(LEVEL)
  53. VERS = $(BETA) -DVERSION=\"$(VSTR)\"
  54.  
  55. ifeq ($(strip $(BETA)),)
  56. VERS := $(VERS) -DNDEBUG
  57. endif
  58.  
  59.  
  60. #######################
  61. #                     #
  62. #  Compiler Variables #
  63. #                     #
  64. #######################
  65.  
  66. #
  67. # Defines whether or not you are using GCC 2.6.x (or greater)
  68. # which support ELF *and* a.out - Redefine this in 'make.inc' to
  69. # 'USEELF = 1' if you have a system that compiles BOTH ELF and a.out.
  70. #
  71. # Use this for GCC 2.5.x or for 2.6.x a.out-only compiler setup, or
  72. # for an ELF-only setup
  73. #
  74. # This variable is ONLY used to help determine the flags for the CC variable
  75. # for systems that can compile both types of executable formats.
  76. #
  77. USEELF =
  78.  
  79. #
  80. # Linking type - default is static linking - For dynamic linking, redefine
  81. # this in 'make.inc' as 'LTYPE ='
  82. #
  83. LTYPE = -static
  84.  
  85.  
  86. #######################
  87. #                     #
  88. # Commands/Parameters #
  89. #                     #
  90. #######################
  91.  
  92. #
  93. # Executable command names
  94. #
  95. # These are processed BEFORE the inclusion of any 'make.inc' files, to allow
  96. # you to easily override them to your needs.
  97. #
  98. # NOTE: If you alter the USEELF variable, you *MAY* wish to
  99. # also change the definition for CC in your 'make.inc' file.
  100. #
  101. ifeq (USEELF,1)
  102. CC        = gcc -b i486-linuxaout
  103. else
  104. CC        = gcc
  105. endif
  106. RM        = rm -f
  107. AR        = ar rc
  108. MV        = mv -f
  109. MKDIR        = mkdir
  110. RANLIB        = ranlib
  111. CHMOD        = chmod
  112. FTPBASE        = ~ftp/tnos
  113. DIRMODE        = 777
  114. INSTALL        = install -c
  115. CO        = co
  116. CI        = ci
  117. RCS        = rcs
  118. COFLAGS        = -q -M
  119. STRIP        = true
  120. COFF2EXE    = true
  121. TCL        = tclsh
  122. C2MAN        = c2man ${VERS} ${PATCHES} -DOPTIONAL="" -DUNIX -oman/man3 \
  123.             -DNOSDIR=\"$(NOSDIR)\" ${ICURSES} ${ISQL} \
  124.             "-MTNOS Development Manual"
  125. C2MAN_AUTO    = ${C2MAN}
  126. POSTPROCESS    = true
  127. CATALOGPADDING  = 0
  128. JOBS        = 1
  129.  
  130.  
  131. #######################
  132. #                     #
  133. #  Supported Patches  #
  134. #                     #
  135. #######################
  136.  
  137. #
  138. # Supported patches are:
  139. #
  140. # -DUSE_SETSTACK    Use the WAMPES setstack() tasking method
  141. # -DDUMP_CORE        Don't try to recover cleanly after a system fault
  142. #
  143. PATCHES = 
  144.  
  145. #
  146. # Change this to 'SETSTACK= setsp.o' in 'make.inc' if you redefine PATCHES to
  147. # use -DUSE_SETSTACK. NOTE: PATCHES and SETSTACK **MUST** agree on
  148. # whether or not SETSTACK is being used.
  149. #
  150. SETSTACK= 
  151.  
  152.  
  153.  
  154. #######################
  155. #                     #
  156. #   Curses Library    #
  157. #                     #
  158. #######################
  159.  
  160. #
  161. # Your curses library.  Linux wants ncurses; System V wants curses; BSD wants
  162. # curses, termcap, and major work to substitute for missing features in BSD
  163. # curses.  (Or install ncurses.)
  164. #
  165. # Slackware 1.1.0 and later use the convention of the ncurses headers with the
  166. # traditional names in /usr/include/ncurses; sources compiled for BSD curses
  167. # compile as is, for ncurses sources use -I/usr/include/ncurses and the source
  168. # need not be changed.  This is a Good Thing.  (If you're not using ncurses,
  169. # you don't need the ICURSES line.)  If your ncurses isn't installed that way,
  170. # curses.h will be used.
  171. #
  172. # The default is now for the newer ncurses (or regular curses) where the
  173. # header file is /usr/include/curses.h and the library is libncurses (in the
  174. # normal library path.
  175. #
  176. # FreeBSD installs ncurses in /usr/include, so for that OS, you will want
  177. # to override these lines in 'make.inc'
  178. #
  179. ICURSES =
  180. LCURSES = -lncurses
  181.  
  182.  
  183. #######################
  184. #                     #
  185. #     SQL Library     #
  186. #                     #
  187. #######################
  188.  
  189. #
  190. # Location of the needed SQL library, if you are using the SQL support.
  191. # If SQL is NOT defined for your compile, redefine the next two lines in
  192. # 'make.inc' as 'LSQL=' and 'ISQL='. If you ARE using SQL, then make sure
  193. # that the LSQL and ISQL lines point to the location of your SQL library,
  194. # and the directory with any needed include files for you SQL library.
  195. # If they do not, override these lines in 'make.inc'.
  196. #
  197. LSQL = -L/usr/local/Minerva/lib -lmsql
  198. ISQL = -I/usr/local/Minerva/include
  199.  
  200.  
  201. #######################
  202. #                     #
  203. # Warnings -- friends #
  204. #                     #
  205. #######################
  206.  
  207. #
  208. # Warnings --- disable for less noise, enable for more certainty :-)  gcc will
  209. # whine about things like partly bracketed initializers if you specify -W, but
  210. # this can be ignored unless you're trying to port JNOS to VMS....
  211. #
  212. # TNOS/Linux is much cleaner in this area, but there are some portability
  213. # warnings still (-Wtraditional) and some non-globally-prototyped functions.
  214. #
  215. WARNINGS = -W -Wall -Wpointer-arith -Wcast-align -Wtraditional \
  216.     -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \
  217.     -Wnested-externs -Wcomment -Winline -Wid-clash-31 \
  218.     -Wwrite-strings $(TOUGHWARNINGS) $(OPTIONAL) # -Wconversion
  219.  
  220.  
  221. TOUGHWARNINGS = -Wshadow    # -Wredundant-decls -Werror
  222.  
  223.  
  224. #
  225. # If you are using a non-GCC compiler, or a GCC compiler prior to 2.7.0, you
  226. # will want to keep this next line as it is. You will probably get several
  227. # warnings about unused parameters to functions, but those are to be expected.
  228. # If you are using GCC 2.7.0 or later, override this line in 'make.inc' to
  229. # 'OPTIONAL = "-DOPTIONAL=__attribute__ ((unused))"'
  230. #
  231. OPTIONAL = "-DOPTIONAL="
  232.  
  233.  
  234. #######################
  235. #                     #
  236. #     OPTIMIZATION    #
  237. #                     #
  238. #######################
  239.  
  240. #
  241. # This should normally be fine, but if you encounter unusual errors compiling,
  242. # and the code LOOKS good, try redefining this in 'make.inc' as 'OPTIMIZE='
  243. #
  244. OPTIMIZE = -O2 -Wuninitialized 
  245.  
  246.  
  247.  
  248. #######################
  249. #                     #
  250. # Debugging Variables #
  251. #                     #
  252. #######################
  253.  
  254. #
  255. # The following definition can be used to compile in code to help profile
  256. # the performance of TNOS. I do NOT suggest it's use in real-world situations,
  257. # as it adds to the size of the executable, uses more memory, and slows down
  258. # the execution of the program. If you DO wish to use it, though, then
  259. # override it in 'make.inc' as 'PROFILE = -pg'
  260. #
  261. PROFILE =
  262.  
  263.  
  264. #
  265. # I strongly advise leaving the debugging information in, because this is NOT
  266. # production-quality code.  -g1 instead of -g3 will make nos smaller, however,
  267. # and leaving off -g entirely will make it a LOT smaller.
  268. #
  269. # I *DO*, though, remove the debugging info from official distribution
  270. # executables, in the interest of keeping download sizes smaller.
  271. #
  272. # The DBGLIB could be overriden in 'make.inc' to 'DBGLIB=-lefence' to compile
  273. # using the publicly available memory debugging tool 'Electric Fence', or
  274. # for other debugging libraries. 'Electric Fence' is not required for TNOS.
  275. #
  276. DEBUG =  $(PROFILE) -g3
  277. DBGLIB =
  278.  
  279.  
  280. #
  281. # This is for use in testing.  Don't worry about it unless you want to be
  282. # able to build custom versions.
  283. #
  284. NOS = tnos
  285.  
  286.  
  287.  
  288. ###############
  289. #             #
  290. # Directories #
  291. #             #
  292. ###############
  293.  
  294. #
  295. # These define the root directory that you want TNOS installed into. You
  296. # *WILL* want to override these in 'make.inc', if you wish to install TNOS
  297. # anywhere else but '/nos'.
  298. #
  299. NOSDIR = /nos
  300. NOSDIRSTR = /nos
  301.  
  302.  
  303.  
  304. #############################
  305. #                           #
  306. # User and System Overrides #
  307. #                           #
  308. #############################
  309.  
  310.  
  311. #
  312. # Include any files overridding any of these variables, if they exist
  313. #
  314. ifeq (make.inc,$(wildcard make.inc))
  315. include make.inc
  316. endif
  317. ifeq (make.inc-${OSTYPE},$(wildcard make.inc-${OSTYPE}))
  318. include make.inc-${OSTYPE}
  319. endif
  320.  
  321.  
  322.  
  323. ####################################################
  324. #                                                  #
  325. # No user overridable variables beyond this point! #
  326. #                                                  #
  327. # Don't touch! This means you!                     #
  328. #                                                  #
  329. ####################################################
  330.  
  331.  
  332. CDEPFLAGS = $(LTYPE) -DUNIX $(ICURSES) $(ISQL)
  333. RCSFILELIST= *.[ch] *.dat *.in *.tcl *.chk *.hlp premake* makefile.* README* *make.inc* kbraw.s makeinc.dos makefile.all
  334.  
  335.  
  336.  
  337. ############################
  338. #                          #
  339. # The primary targets used #
  340. #                          #
  341. ############################
  342.  
  343.  
  344. include makefile.all
  345.  
  346. $(NOS): improper catalog.h $(REQUIRED)
  347.     ${MAKE} -j $(JOBS) $(LIBS)
  348.     echo --- Indexing All Archives
  349.     $(RANLIB) $(LIBS)
  350.     if [ -f $(NOS) ] ; \
  351.     then \
  352.         $(MV) $(NOS) $(NOS).bak; \
  353.     fi
  354.     echo --- Linking: $(NOS)
  355.     $(CC) $(CFLAGS) -o $(NOS) $(REQUIRED) $(LIBS) $(LCURSES) $(DBGLIB) $(LSQL) $(SYSLIBS)
  356.     -./mkvers $(NOSDIR)
  357.     ${POSTPROCESS}
  358. #    echo --- Removing unneeded RCS files
  359. #    rcsclean $(RCSFILELIST)
  360.  
  361.  
  362. ##############################################
  363. #                                            #
  364. # Definition for making certain header files #
  365. #                                            #
  366. ##############################################
  367.  
  368.  
  369. hardware.h: unix.h
  370.     cp unix.h hardware.h
  371.  
  372. config.h: mkconfig.tcl config.in
  373.     NOSDIR=${NOSDIR} $(TCL) mkconfig.tcl
  374.  
  375. catalog.h: catalog.dat buildcat
  376.     ./buildcat ${CATALOGPADDING}
  377.  
  378. make.inc:
  379.     ./build-make.inc
  380.     
  381.  
  382. ##########################
  383. #                        #
  384. # Administrative targets #
  385. #                        #
  386. ##########################
  387.  
  388.  
  389. zapVersion:
  390.     echo --- Removing Version-specific object files
  391.     -$(RM) mkvers version.o mailbox.o catalog.o register.o
  392.  
  393. clean:
  394.     $(RM) *.[oa] setsp.s $(MISCEXE) mkvers
  395.  
  396. realclean: clean
  397.     $(RM) config.h hardware.h .depend
  398.     $(RM) $(NOS) $(NOS).bak
  399.  
  400.  
  401. depend dep: hardware.h config.h catalog.h
  402.     echo --- Determining Dependencies
  403.     $(CC) -MM $(CDEPFLAGS) $(PATCHES) *.c >.depend
  404.  
  405. initial:
  406.     test -d $(NOSDIR) || \
  407.       $(MKDIR) $(NOSDIR) && \
  408.       $(CHMOD) $(DIRMODE) $(NOSDIR)
  409.     for d in etc spool public finger spool/mail spool/mqueue etc/help \
  410.            spool/info spool/news spool/signatur spool/cmds ; do \
  411.         test -d $(NOSDIR)/$$d || \
  412.           $(MKDIR) $(NOSDIR)/$$d && \
  413.         $(CHMOD) $(DIRMODE) $(NOSDIR)/$$d ; \
  414.     done
  415.     
  416. install:
  417.     $(INSTALL) $(NOS) $(NOSDIR)
  418.     $(INSTALL) ctlcheck $(NOSDIR)
  419.     $(INSTALL) buildctl $(NOSDIR)
  420.  
  421.  
  422. touch:
  423.     -touch config.h catalog.h
  424.     -touch *.o
  425.     -touch *.a
  426.     -touch ctlcheck buildctl deldep mkvers
  427.  
  428.  
  429. tgz: 
  430.     -rm -f Tnos-$(VSTR)-src.tar.gz
  431.     echo --- Adding source files to TAR.GZ file
  432.     tar czf Tnos-$(VSTR)-src.tar.gz README *.[ch] premake* \
  433.         makefile.[adu]* config.[chi]* catalog.dat *.in \
  434.         *.tcl build-make.inc make.inc-* makeinc.dos kbraw.s
  435.  
  436. zip:
  437.     -rm -f Tnos-$(VSTR)-src.zip
  438.     echo --- Adding source files to ZIP file
  439.     zip -lkzq Tnos-$(VSTR)-src.zip README *.[ch] premake* \
  440.         makefile.[adu]* config.[chi]* makeinc.dos\
  441.         catalog.dat *.in mkconfig.tcl depend kbraw.s -x CONFIG.H \
  442.         -x CATALOG.H -x TNOS.C -x HARDWARE.H <tnos.zipheader
  443.     echo --- Adding DOS executable files to ZIP file
  444.     zip -qk Tnos-$(VSTR)-src.zip tclsh.exe
  445.  
  446. customkt:
  447.     -rm -f customkt.zip
  448.     echo --- Creating CUSTOMKT.ZIP
  449.     zip -lkzq customkt.zip README.KIT config.in mkconfig.tcl <tnoskt.zipheader
  450.     echo --- Adding DOS executable files to ZIP file
  451.     zip -qk customkt.zip tclsh.exe
  452.     
  453.  
  454. patch:
  455.     if [ ! -f patch.kit ] ; \
  456.     then \
  457.         touch patch.kit; \
  458.     fi
  459.     -diff -C 2 -P -w -X patch.kit old . >../Tnos-$(VSTR)-src-diff
  460.  
  461. patch.gz: patch
  462.     gzip ../Tnos-$(VSTR)-src-diff
  463.  
  464. applypatch:
  465.     -patch -p1 -s -l <patchkit*
  466.     -rm patchkit*
  467.  
  468. cleanpatch:
  469.     -rm *.orig
  470.  
  471. co:
  472.     $(CO) $(COFLAGS) -l RCS/*.[ch],v RCS/*.in,v RCS/*.tcl,v \
  473.         catalog.dat RCS/README* RCS/kbraw.s,v \
  474.         RCS/makefile.[adu]*,v RCS/premake*,v RCS/make.inc-*,v \
  475.         config.chk make.inc config.hlp build-make.inc makeinc.dos
  476.     -touch config.h
  477.  
  478. ci:
  479.     $(CI) "-mInterim checkin $(VSTR)" $(RCSFILELIST)
  480.  
  481. update:
  482.     $(CI) -l "-mInterim checkin $(VSTR)" $(RCSFILELIST)
  483.  
  484. rcsset:
  485.     echo --- Setting all source files to Release$(VERSION)_$(RELEASE)$(LEVEL)$(SUBTYPE)$(SUBLEVEL)
  486.     $(RCS) -q -nRelease$(VERSION)_$(RELEASE)$(LEVEL)$(SUBTYPE)$(SUBLEVEL): RCS/* >/dev/null
  487.  
  488. rcsclean:
  489.     rcsclean -u $(RCSFILELIST) Makefile
  490.  
  491. rcsbase:
  492.     $(CO) $(COFLAGS) config.h mkconfig.tcl config.in config.hlp
  493.     -touch config.h
  494.  
  495. unlock:
  496.     rcs -u *.[ch] *.dat *.in *.tcl *.chk makefile* makeinc.dos
  497.  
  498. makeman:
  499.     echo --- Creating MAN pages from the C files
  500.     for fname in `ls *.c | grep -v setsp | grep -v netdump | grep -v mboxcmd` ; do \
  501.         ${C2MAN} $${fname}; \
  502.     done
  503.  
  504. makecat:
  505.     echo --- Retrieving current MAN page from ftp site
  506.     cp -f $(FTPBASE)/TDP/man/tnos.man man/man1/tnos.1
  507.     echo --- Creating CAT pages from the MAN pages
  508.     nroff -man man/man1/tnos.1 >man/cat1/tnos.1
  509.     rm -f man/cat3/*
  510.     ( cd man/man3; \
  511.     for fname in `ls *` ; do \
  512.         nroff -man $${fname} >../cat3/$${fname}; \
  513.     done )
  514.  
  515.  
  516. manfiles: makeman makecat
  517.  
  518. release: rcsset
  519.     echo --- Obtaining Current MAIN.C file
  520.     rm -f main.c main.o
  521.     $(CO) $(COFLAGS) -lRelease$(VERSION)_$(RELEASE)$(LEVEL)$(SUBTYPE)$(SUBLEVEL) main.c
  522.     $(MAKE) tgz
  523.     $(MAKE) zip
  524.  
  525. releasebase:
  526.     echo --- Preparing CONFIG.CFG, NODE/VERSION.HLP for DOS base files archive
  527.     cp -f config.cfg.dos /dos/nos.dos/etc/config.cfg
  528.     unix2dos /nos/etc/help/version.hlp /dos/nos.dos/etc/help/version.hlp
  529.     unix2dos /nos/etc/help/node.hlp /dos/nos.dos/etc/help/node.hlp
  530.     echo --- Preparing FEATURES.NEW and NEW2TN$(VSTR) for DOS base files archive
  531.     unix2dos features.new /dos/nos.dos/features.new
  532.     unix2dos new2tn$(VSTR) /dos/nos.dos/doc/new2tn$(VSTR)
  533.     echo --- Preparing SETUP.IN and MKSETUP.TCL for DOS base files archive
  534.     unix2dos setup.in /dos/nos.dos/setup.in
  535.     unix2dos mksetup.tcl /dos/nos.dos/mksetup.tcl
  536.     echo --- Preparing DOS executable for DOS base files archive
  537.     cp -f msdos/tnos.exe /dos/nos.dos/
  538.     echo --- Creating DOS base files archive
  539.     cd /dos/nos.dos ; \
  540.     zip -krqz /home/src/tnos/base.zip * <info.$(VERSION)$(RELEASE)$(LEVEL)
  541.     echo --- Preparing Linux executable for UNIX base files archive
  542.     cp -f tnos /dos/nos.lnx/tnos
  543.     strip /dos/nos.lnx/tnos
  544.     echo --- Preparing CATALOG.CAT, CONFIG.CFG and NODE/VERSION.HLP for UNIX base files archive
  545.     cp -f /nos/etc/catalog.cat /dos/nos.lnx/etc/catalog.cat
  546.     cp -f /nos/etc/config.cfg /dos/nos.lnx/etc/config.cfg
  547.     cp -f /nos/etc/help/version.hlp /dos/nos.lnx/etc/help/version.hlp
  548.     cp -f /nos/etc/help/node.hlp /dos/nos.lnx/etc/help/node.hlp
  549.     echo --- Preparing FEATURES.NEW and NEW2TN$(VSTR) for UNIX base files archive
  550.     cp -f features.new /dos/nos.lnx/features.new
  551.     cp -f new2tn$(VSTR) /dos/nos.lnx/doc/new2tn$(VSTR)
  552.     echo --- Creating UNIX base files archive
  553.     cd /dos/nos.lnx ; tar czf /home/src/tnos/base.tgz *
  554.  
  555. releasedoc:
  556.     echo --- Creating DOS doc files archive
  557.     cd /dos/nos.dos/doc ; \
  558.     zip -krq /home/src/tnos/doc.zip *
  559.     echo --- Creating UNIX doc files archive
  560.     cd /dos/nos.lnx/doc ; tar czf /home/src/tnos/doc.tgz *
  561.  
  562. releaseman:
  563.     #echo --- Creating DOS MAN archive
  564.     # only the tnos.1 cat file, due to DOS 8.3 naming convention
  565.     #zip -klq man.zip man/man1
  566.     #zip -klrq man.zip man/cat1
  567.     echo --- Creating UNIX MAN archive
  568.     tar czf man.tgz man
  569.  
  570. releasenotes:
  571.     echo --- Copying current Release Notes for Release $(VSTR)
  572.     cd $(FTPBASE)/TDP/ReleaseNotes; \
  573.     mkdir Release$(VSTR); \
  574.     chmod 755 Release$(VSTR); \
  575.     cp Current/*.gif Release$(VSTR); \
  576.     cp Current/*.sgml Release$(VSTR)/tn$(VERSION)_$(RELEASE)$(LEVEL).sgml; \
  577.     chmod 644 Release$(VSTR)/*; \
  578.     cd Release$(VSTR); ln -s tn$(VERSION)_$(RELEASE)$(LEVEL).html index.html
  579.  
  580. zapDOS:
  581.     echo --- Removing Version-specific object files from DOS directory
  582.     -cd msdos; $(RM) mkvers version.o mailbox.o catalog.o register.o main.o
  583.     
  584. releaseall: release zapVersion Version zapDOS tnos.ext releasebase makecat releaseman releasedoc
  585.  
  586. installrelease:
  587.     echo --- Creating new release directory at ftp site
  588.     -rm -rf $(FTPBASE)/release$(VSTR)
  589.     -mkdir $(FTPBASE)/release$(VSTR)
  590.     -mkdir $(FTPBASE)/release$(VSTR)/unix
  591.     -mkdir $(FTPBASE)/release$(VSTR)/dos
  592.     cd $(FTPBASE); rm -f new; ln -s release$(VSTR) new; chmod 600 release$(VSTR)
  593.     echo --- Installing source archives to ftp site
  594.     mv Tnos-$(VSTR)-src.tar.gz $(FTPBASE)/new/unix/
  595.     mv Tnos-$(VSTR)-src.zip    $(FTPBASE)/new/dos/tnos$(DVSTR)s.zip
  596.     echo --- Installing base archives to ftp site
  597.     mv base.tgz $(FTPBASE)/new/unix/Tnos-$(VSTR).tar.gz
  598.     mv base.zip $(FTPBASE)/new/dos/tnos$(DVSTR)b.zip
  599.     echo --- Installing man archives to ftp site
  600.     mv man.tgz $(FTPBASE)/new/unix/Tnos-$(VSTR)-man.tar.gz
  601.     #mv man.zip $(FTPBASE)/new/dos/tnos$(DVSTR)m.zip
  602.     echo --- Installing doc archives to ftp site
  603.     mv doc.tgz $(FTPBASE)/new/unix/Tnos-$(VSTR)-doc.tar.gz
  604.     mv doc.zip $(FTPBASE)/new/dos/tnos$(DVSTR)d.zip
  605.     #echo --- Installing DOS customkit archive to ftp site
  606.     #mv customkt.zip $(FTPBASE)/current/dos/
  607.     echo --- Installing DOS executable to ftp site
  608.     cp -f msdos/tnos.exe $(FTPBASE)/new/dos/
  609.     chmod 444 $(FTPBASE)/new/dos/tnos.exe
  610.     echo --- Fixing permissions on ZIP and GZ files installed
  611.     chmod 444 $(FTPBASE)/new/dos/*.zip
  612.     chmod 444 $(FTPBASE)/new/unix/*.gz
  613.     echo --- Copying the features.new file to ftp site
  614.     cp -f features.new $(FTPBASE)/new/unix/
  615.     chmod 444 $(FTPBASE)/new/unix/features.new
  616.     unix2dos features.new $(FTPBASE)/new/dos/features.new
  617.     chmod 444 $(FTPBASE)/new/dos/features.new
  618.     echo --- Copying the old README and tn-read.me files to ftp site
  619.     cp -f $(FTPBASE)/current/unix/README $(FTPBASE)/new/unix
  620.     cp -f $(FTPBASE)/current/unix/tn-read.me $(FTPBASE)/new/unix
  621.     chmod 444 $(FTPBASE)/new/unix/README $(FTPBASE)/new/unix/tn-read.me
  622.     cp -f $(FTPBASE)/current/dos/README $(FTPBASE)/new/dos
  623.     cp -f $(FTPBASE)/current/dos/tn-read.me $(FTPBASE)/new/dos
  624.     chmod 444 $(FTPBASE)/new/dos/README $(FTPBASE)/new/dos/tn-read.me
  625.     echo "--- Copying the new2tn* files to the ftp site"
  626.     cp -f $(FTPBASE)/current/unix/new2tn* $(FTPBASE)/new/unix/
  627.     cp -f new2tn$(VSTR)  $(FTPBASE)/new/unix/
  628.     chmod 444 $(FTPBASE)/new/unix/new2tn*
  629.     cp -f $(FTPBASE)/current/dos/new2tn* $(FTPBASE)/new/dos/
  630.     unix2dos new2tn$(VSTR) $(FTPBASE)/new/dos/new2tn$(VSTR)
  631.     chmod 444 $(FTPBASE)/new/dos/new2tn*
  632.  
  633.     echo --- Installing symlinks at ftp site
  634.     cd $(FTPBASE)/new/unix; \
  635.         ln -s ../../misc/cnvfwd; \
  636.         ln -s ../../faq; ln -s ../../TDP; \
  637.         ln -s TDP/tnosfwd/tnosfwd.txt; \
  638.         ln -s TDP/tscript/tscript.txt tscript.doc
  639.     cd $(FTPBASE)/new/dos; \
  640.         ln -s ../../misc/cnvfwd.exe; \
  641.         ln -s ../../faq; ln -s ../../TDP; \
  642.         ln -s TDP/tnosfwd/tnosfwd.txt; \
  643.         ln -s TDP/tscript/tscript.txt tscript.doc
  644.  
  645. lintmisc:
  646.     -flexelint +vm /etc/std.lnt nos -e14 -e15 -e515 -e532 -e533 \
  647.         buildcat.c buildctl.c checkcat.c ctlcheck.c \
  648.         deldep.c mkvers.c cnvfwd.c statconv.c >_lint.out
  649.  
  650. linttnos:
  651.     -flexelint +vm /etc/std.lnt nos linted >_lint.out1
  652.  
  653. lint: linttnos lintmisc
  654.  
  655.  
  656. #######################################
  657. #                                     #
  658. # Special cases for certain *.c files #
  659. #                                     #
  660. #######################################
  661.  
  662.  
  663. setsp.o: setsp.c
  664.     echo --- Compiling: $<
  665.     $(CC) -E $< >setsp.s; cc -c setsp.s
  666.  
  667.  
  668. #
  669. # unix.o is special cased, because of a bug in GCC 4.6.x that improperly
  670. # optimizes, causing CPU time to DEVOUR all available.
  671. #
  672. unix.o: unix.c
  673.     echo --- Compiling: $<
  674.     $(CC) $(LTYPE) -DUNIX $(DEBUG) $(PATCHES) $(WARNINGS) $(ICURSES) $(VERS) -c unix.c -o unix.o
  675.  
  676.  
  677.  
  678. #####################################################################
  679. #                                                                   #
  680. # Special rules to build MSDOS executable using Unix cross-compiler #
  681. #                                                                   #
  682. #####################################################################
  683.  
  684.  
  685. dos:
  686.     test -d msdos || $(MKDIR) msdos
  687.     echo --- Checking for required config.h file
  688.     if [ ! -e config.dos ] ; then \
  689.         echo ""; \
  690.         echo "You must place a MSDOS config.h file in this directory"; \
  691.         echo "named 'config.dos' to match the features you wish to"; \
  692.         echo "compile for this MS-DOS compile"; \
  693.         echo ""; \
  694.         exit 1; \
  695.     fi
  696.     echo --- Creating any missing symlinks
  697.     for f in `ls *.[chs]` config.chk catalog.dat makefile.all; do \
  698.         if [ ! -e msdos/$$f ]; then \
  699.             ln -s ../$$f msdos/$$f; \
  700.         fi; \
  701.     done; \
  702.     cd msdos; \
  703.     ln -s -f ../config.dos config.h; \
  704.     ln -s -f ../makefile.dos Makefile; \
  705.     ln -s -f ../nospc.h hardware.h; \
  706.     ln -s -f ../makeinc.dos make.inc; \
  707.     echo --- Making TNOS/DOS; \
  708.     ${MAKE} "NOS=$(NOS)" -i all
  709.     echo --- MSDOS executables completed - located in the \"msdos\" directory
  710.  
  711.  
  712. $(NOS).exe: dos
  713.     cd msdos; make "NOS=$(NOS)" $(NOS).exe
  714.  
  715. doslint:
  716.     -cd msdos;flexelint +vm /etc/std.lnt ../go32 ../linted >_lint.out
  717.  
  718.  
  719.  
  720. ##################
  721. #                #
  722. # Explicit rules #
  723. #                #
  724. ##################
  725.  
  726.  
  727. .c.o:
  728.     echo --- Compiling: $<
  729.     $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
  730.     ${C2MAN_AUTO} $<
  731.  
  732. #
  733. # and include a dependency file if one exists, which it SHOULD
  734. #
  735. ifeq (.depend,$(wildcard .depend))
  736. include .depend
  737. endif
  738.  
  739.  
  740. .SILENT:
  741.  
  742.  
  743. .PHONY: man makeman makecat improper
  744.  
  745.  
  746. #
  747. # finally, allow the user to define additional targets.
  748. # this is done at the end, rather than in make.inc, to avoid
  749. # having the default target of 'all' changed.
  750. #
  751. ifeq (make.end,$(wildcard make.end))
  752. include make.end
  753. endif
  754.  
  755.